//
//  UIView+QNExtension.h
//  QNReuseTool
//
//  Created by rsh on 2019/10/15.
//  Copyright © 2019年 rsh. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MBProgressHUD/MBProgressHUD.h>   //另一种网络加载（自定义吐丝效果）

@interface UIView (QNExtension)

@property(nonatomic, assign) IBInspectable CGFloat cornerRadius;
@property(nonatomic, assign) IBInspectable CGFloat borderWidth;
@property(nonatomic, strong) IBInspectable UIColor *borderColor;

@property(nonatomic, assign) IBInspectable CGFloat shadowRadius;
@property(nonatomic, assign) IBInspectable CGFloat shadowOpacity;
@property(nonatomic, assign) IBInspectable UIColor *shadowColor;

@property (assign, nonatomic) CGFloat x;
@property (assign, nonatomic) CGFloat y;
@property (assign, nonatomic) CGPoint origin;

@property (assign, nonatomic) CGFloat centerX;
@property (assign, nonatomic) CGFloat centerY;

@property (assign, nonatomic) CGFloat width;
@property (assign, nonatomic) CGFloat height;
@property (assign, nonatomic) CGSize  size;

@property (nonatomic, strong) UIViewController *responesVC;

- (void)addBadge:(NSInteger)number font:(UIFont *)font position:(CGPoint)position;


/**
 设置上边圆角
 */
- (void)setCornerOnTop:(CGFloat) conner;

/**
 设置下边圆角
 */
- (void)setCornerOnBottom:(CGFloat) conner;
/**
 设置左边圆角
 */
- (void)setCornerOnLeft:(CGFloat) conner;
/**
 设置右边圆角
 */
- (void)setCornerOnRight:(CGFloat) conner;

/**
 设置左上圆角
 */
- (void)setCornerOnTopLeft:(CGFloat) conner;

/**
 设置右上圆角
 */
- (void)setCornerOnTopRight:(CGFloat) conner;
/**
 设置左下圆角
 */
- (void)setCornerOnBottomLeft:(CGFloat) conner;
/**
 设置右下圆角
 */
- (void)setCornerOnBottomRight:(CGFloat) conner;

/**
 设置左边和右上圆角--（更多活动）
 */
- (void)setCornerOnLeftAndTopRight:(CGFloat) conner;


/**
 设置所有圆角
 */
- (void)setAllCorner:(CGFloat) conner;


//在view上添加一个MBProgressHUD的吐丝（UIWindow上）
-(void)showMBProgressHUDWithMessage:(NSString *)message;




/**
 View添加点击事件
 
 @param action 事件响应方法
 */
- (void)addTapGestureAction:(nullable SEL)action withTarget:(nullable id)target;


/**
 画虚线
 */
- (void)drawLineOfDashByCAShapeLayer:(UIView *_Nullable)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *_Nullable)lineColor lineDirection:(BOOL)isHorizonal;


@end
